require([
  'jquery',
  'pageInit',
  'dataTableFilter',
  'loading',
], function($, vamakerPage, VamDataTable, VamLoader) {
  $(function() {
    var 
      $dataTable = $('#data-table'),
      dataUrl = VAM.getVar('OPERATE_LOG_DATA_LIST'),
      $reportDataThead = $dataTable.find('thead'),
      $loadingWrap = new VamLoader().loader($('#list-loading-wrap')),
    listTable, tableOptions = {};
    // Table settings.
    tableOptions = {
      'ajax': {
        'url': dataUrl
      },
      'order': [5,'desc'],
      'columns': [
        {'data': 'id'},
        {'data': 'userId'},
        {'data': 'userType'},
        {'data': 'ip'},
        {'data': 'operateObject'},
        {'data': 'operateDate'},
        {'data': 'operate'}
      ],
      'columnDefs': [
        {
          'targets': [0,1,2,3,4,5,6],
          'render': function (data, type, full, meta) {
            return '<p title="' + data + '">' + data +'</p>'
          }
        }
      ],
      'initComplete': function() {
        tableResize = new VamDataTable().columnResize($dataTable);
      }
    };
    $dataTable
    .on('preXhr.dt', function(evt) {
      $loadingWrap.show();
    });
    listTable = new VamDataTable().dataTables($dataTable, tableOptions);
    // After table data list.
    listTable.on('xhr.dt', function(evt) {
      $loadingWrap.fadeOut();
    });

    // $dataTable.on('click', 'tbody td .tab-edit', function (evt) {
    //   var $me = $(this),
    //     $rowData = $me.siblings('.row-info'),
    //     opId = $rowData.val(),
    //     opType = $me.data('type'),
    //     opData;
    //   opData = {
    //     id: opId,
    //     type: opType,
    //     rnd: (new Date()).getTime()
    //   };
    //   SL.fn.ButtonLoading($me);
    //   SL.fn.tableOpAsync(opData, $me, dataList, tableHeader);
    // });
  });
});
